package com.example.dmdomain.entity;

import io.swagger.models.auth.In;
import lombok.Data;
import org.ehcache.shadow.org.terracotta.context.annotations.ContextChild;
import org.postgresql.util.PGInterval;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "account_strategy")
public class AccountStrategy {

	/**
	 * 策略1：指定每日开始、结束时间
	 */
	public static final int TYPE_BY_HOUR = 0;

	/**
	 * 策略2：指定可使用时长
	 */
	public static final int TYPE_BY_INTERVAL = 1;

	@Id
	@Column(name = "user_type")
	private Integer userType;

	@Column(name = "start_time")
	private Date startTime;

	@Column(name = "end_time")
	private Date endTime;

	@Column(name = "type")
	private Integer type;

	@Column(name = "interval")
	private Integer interval;
}
